﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;

namespace Himp.TaskScheduling
{
    /// <summary>
    /// 
    /// </summary>
    public class ParamConfigValueService : TaskSchedulingAppService, IParamConfigValueService
    {
        private ParamConfigManager _paramConfigManager;

        public ParamConfigValueService(ParamConfigManager paramConfigManager)
        {
            _paramConfigManager = paramConfigManager;
        }

        public async Task<Dictionary<string,object>> GetListAsync(ParamConfigValueInput input)
        {
            if (input.Keys == null || input.Keys.Count == 0)
            {
                return await _paramConfigManager.GetValues();
            }

            return await _paramConfigManager.GetValues(input.Keys);
        }

        public async Task<List<string>> GetKeyListAsync()
        {
            return await _paramConfigManager.GetKeys();
        }
    }
}
